package com.robot.common.task;


import com.robot.common.websocket.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class WebSocketTask {

    @Autowired
    private WebSocketServer webSocketServer;


    @Scheduled(cron = "0/5 * * * * ?")
    public void sendWebSocketMessage() {
        webSocketServer.sendToAllClient("Hello, 世界!");
    }
}
